{{ define "main" }}

<div class="max-w-prose mx-auto flex justify-center">
  <article class="prose prose-slate lg:prose-xl dark:prose-invert">
    <h1 class="lg:text-6xl">{{ .Title }}</h1>
    {{ .Content }}
  </article>
</div>

{{ $view := .Params.view | default "card" }}
{{ $block := . }}

<div class="flex flex-col items-center">

  {{ partial "functions/render_view" (dict "fragment" "start" "page" $block "item" . "view" $view) }}

  {{ $paginator := .Paginate .Pages.ByDate.Reverse }}
  {{ range $index, $item := $paginator.Pages }}
  {{ partial "functions/render_view" (dict "page" . "item" . "view" $view "index" $index) }}
  {{end}}

  {{ partial "functions/render_view" (dict "fragment" "end" "page" $block "item" . "view" $view) }}

  {{ partial "components/paginator" . }}

</div>

{{ end }}
